<template>
<uni-shadow-root class="partials-form_detail-index"><form @submit="formSubmit">
<slot></slot>
<view class="formDetailContent" report-submit v-if="formData" :style="'margin-bottom: '+(showformSubmitBtn?'100rpx':'0rpx')+';'">
  <view class="formBanner" v-if="formData.banner">
    <image class="bannerUrl" :src="formData.banner" mode="widthFix"></image>
  </view>
  <view class="formContent" v-if="formData&&formData.items&&formData.items.length!=0">
    <view v-for="(itemData,index) in (formData.items)" v-if="controlFieldShow[itemData.name]">
        
        <view class="inputString common" v-if="itemData.type==0">
          <view class="inputName">
            <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
            <text>{{itemData.title}}</text>
          </view>
          <input :name="itemData.name" :data-name="itemData.name" @input="saveSearchValue" :value="itemData.defaultValue" :placeholder="itemData.remark"></input>
        </view>
        <view v-if="itemData.type">
            
            <view class="inputString common" v-if="itemData.type&&itemData.type==1">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <input type="digit" :name="itemData.name" :data-name="itemData.name" @input="saveSearchValue" :value="itemData.defaultValue" :placeholder="itemData.remark"></input>
            </view>
            
            <view class="inputString" v-if="itemData.type&&itemData.type==9999">
              <view class="interval" :style="'height:'+(itemData.splitStyle.title?'':itemData.splitStyle.height)+'px;background:'+(itemData.splitStyle.backgroundColor)" v-if="itemData.splitStyle&&!itemData.splitStyle.banner">
                <text :style="'width:100%;font-size:'+(itemData.splitStyle.fontSize)+'px;color:'+(itemData.splitStyle.color)+';text-align:'+(itemData.splitStyle.textAlign)">{{itemData.splitStyle.title}}</text>
              </view>
              <image class="interval_banner" mode="widthFix" v-if="itemData.splitStyle&&itemData.splitStyle.banner" :src="itemData.splitStyle.banner"></image>
            </view>
            
            <view class="selectType common" v-if="itemData.type&&itemData.type==2">
              <view class="selectName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <image style="width: 30rpx;height: 30rpx;margin-right: 6rpx;" v-if="itemData.icon" :src="itemData.icon"></image>
                <text>{{itemData.title}}</text>
              </view>
              <picker :data-index="index" :data-value="itemData.listValues" @change="bindPickerChange" :name="itemData.name" :value="itemData.defaultValue" :range="itemData.listValues">
                
                <view class="picker">
                  {{selectPicker["picker_"+index]}}
                </view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </picker>
            </view>
            
            <view class="selectType common" v-if="itemData.type&&itemData.type==3" style="align-items:flex-start;padding:10px;flex-direction:column;">
              <view class="selectName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <image style="width: 30rpx;height: 30rpx;margin-right: 6rpx;" v-if="itemData.icon" :src="itemData.icon"></image>
                <text>{{itemData.title}}</text>
              </view>
              <radio-group @change="radioChange" :data-index="index" :data-name="itemData.name" :data-value="itemData.listValues" style="margin:10rpx 20rpx" class="checkboxList">
                <label v-for="(item,idx) in (itemData.listValues)" class="checkbox" :data-index="idx">
                  <radio :color="setting.defaultColor" :value="item.value" :checked="showRadioStateObj['radio_'+index][idx]"></radio>{{item.name}}
                </label>
              </radio-group>
            </view>
            
            <view class="selectType common" v-if="itemData.type&&itemData.type==4" style="align-items:flex-start;padding:10px;flex-direction:column;">
              <view class="selectName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <checkbox-group @change="checkboxChange" :data-index="index" :data-value="itemData.listValues" style="margin:10rpx 20rpx" class="checkboxList">
                <label v-for="(item,index) in (itemData.listValues)" class="checkbox">
                  <checkbox :color="setting.defaultColor" :value="item" :checked="showCheckBoxState[index]"></checkbox>
                  {{item}}
                </label>
              </checkbox-group>
            </view>
            
            <view class="inputString common" v-if="itemData.type&&itemData.type==5">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <picker mode="date" :value="date" :name="itemData.name" :data-index="index" @change="bindDateChange">
                <view class="picker">
                  {{dataAndTime[itemData.name]}}
                </view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </picker>
            </view>
            
            <view class="inputString common" v-if="itemData.type&&itemData.type==6">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <picker mode="time" :data-index="index" :name="itemData.name" :value="time" @change="bindTimeChange">
                <view class="picker">
                  {{dataAndTime[itemData.name]}}
                </view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </picker>
            </view>
            
            <view class="selectType common" v-if="itemData.type&&itemData.type==8">
              <view class="selectName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <picker class="picker" mode="multiSelector" :data-itemData="publicFun.toStringFun(items)" @change="changeDateTime1" @columnchange="changeDateTimeColumn1" :value="dateTimeIndexObj[itemData.name]" :range="dateTimeObj[itemData.name]">
                <view class="pickerValue">{{dataAndTime[itemData.name]}}</view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </picker>
            </view>
            
            <view class="imgType common" v-if="itemData.type&&itemData.type==7">
              <view class="imgName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <view class="upload">
                <view v-for="(img,idx) in (upLoadImageList['img_'+index])" class="uploadedImg">
                  <view class="removeImgIcon" @click="removeImg" :data-index="index" :data-num="idx"><text>x</text></view>
                  <image :data-imageUrl="img" :data-link="img" @longpress="saveImageToLocal" @click="toImgUrl" class="uploadedImgUrl" :src="img" mode="aspectFill"></image>
                </view>
                <view class="uploadImg" @click="addCommitImage" :data-index="index" :data-type="itemData.type">
                  <image class="uploadImgIcon" src="https://image1.sansancloud.com/jianzhan/2018_10/22/18/4/3_874.jpg?x-oss-process=style/preview_120"></image>
                  <text style="font-size:24rpx;color:#555;margin-top:10rpx">添加图片</text>
                </view>
              </view>
            </view>
             
            <view class="inputString common" v-if="itemData.type&&itemData.type==9" style="align-items:flex-start;padding:10px;flex-direction:column;">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <textarea maxlength="-1" auto-height :data-name="itemData.name" @input="saveSearchValue" :placeholder="itemData.remark" :value="itemData.defaultValue" :name="itemData.name"></textarea>
            </view>
            
            <view class="inputString common" v-if="itemData.type&&itemData.type==10">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              
              <view @click="selectRegionFun" :data-index="index">
                <view class="picker">
                  {{region['address_'+index]}}
                </view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </view>
              
            </view>
            
            <view class="imgType common" v-if="itemData.type&&itemData.type==11">
              <view class="imgName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <view class="upload">
                <view v-for="(imgs,idx) in (upLoadImageList['img_'+index])" class="uploadedImg">
                  <view class="removeImgIcon" @click="removeImg" :data-index="index" :data-num="idx">
                      
                      <image style="width: 16rpx;height: 16rpx;" src="https://image1.sansancloud.com/xianhua/2020_3/16/17/57/58_130.jpg?x-oss-process=style/preview_120"></image>
                  </view>
                  <image :data-imageUrl="imgs" :data-link="imgs" @longpress="saveImageToLocal" @click="toImgUrl" class="uploadedImgUrl" :src="imgs" mode="aspectFill"></image>
                </view>
                <view v-if="upLoadImageList['img_'+index].length<9" class="uploadImg" @click="addCommitImage" :data-index="index" :data-type="itemData.type">
                  <image class="uploadImgIcon" src="https://image1.sansancloud.com/jianzhan/2018_10/22/18/4/3_874.jpg?x-oss-process=style/preview_120"></image>
                  <text style="font-size:24rpx;color:#555;margin-top:10rpx">添加图片</text>
                </view>
              </view>
            </view>
            
           <view class="inputString common" v-if="itemData.type&&itemData.type==12">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <view class="form_detail_location" @click.stop.prevent="tolinkUrl" data-link="select_location.html" :data-index="index">
                  
                <input class="select_address" style="width:80%" disabled="disabled" :value="locationList['position_'+index]?locationList['position_'+index].value:''" :placeholder="itemData.remark"></input>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </view>
            </view>
            
            <view class="selectType common" v-if="itemData.type&&itemData.type==13">
              <view class="selectName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <picker class="picker" mode="multiSelector" @click="getCurrentData" :data-itemData="publicFun.toStringFun(itemData)" @change="bindMultiPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex[itemData.name]" :range="multistageData&&multistageData[itemData.name]">
                <view class="pickerValue" v-if="multistageData&&multistageData[itemData.name]&&multistageData[itemData.name].length!=0&&multiIndex&&multiIndex[itemData.name]&&multiIndex[itemData.name].length!=0">
                {{multistageData[itemData.name][0][multiIndex[itemData.name][0]]}} {{multistageData[itemData.name][1][multiIndex[itemData.name][1]]}} {{multistageData[itemData.name][2][multiIndex[itemData.name][2]]}} {{multistageData[itemData.name][3]?multistageData[itemData.name][3][multiIndex[itemData.name][3]]:''}} {{multistageData[itemData.name][4]?multistageData[itemData.name][4][multiIndex[itemData.name][4]]:''}}
                </view>
                <view class="pickerRight">
                  <image class="pickerImg" src="https://image1.sansancloud.com/jianzhan/2018_9/11/13/41/53_722.jpg?x-oss-process=style/preview_120"></image>
                </view>
              </picker>
            </view>
             
            <view class="inputString common" v-if="itemData.type&&itemData.type==14">
              <view class="inputName">
                <text v-if="itemData.mustInput==1&&itemData.title" style="color:red;margin-right:4rpx;width:18rpx">*</text>
                <text>{{itemData.title}}</text>
              </view>
              <input :name="itemData.name" :data-name="itemData.name" @input="saveSearchValue" :value="itemData.defaultValue" :placeholder="itemData.remark"></input>
            </view>
            
            <view class="process_line common" v-if="itemData.type&&itemData.type==15">
              <view class="process_list" v-if="processLineData[itemData.name]&&processLineData[itemData.name].length!=0">
                <view v-for="(processLineItem,index) in (processLineData[itemData.name])" class="process_item">
                  <view class="delete_process_item" :data-name="itemData.name" :data-index="index" @click.stop.prevent="deleteProcessItem">删除</view>
                  <view class="process_item_top">
                    <text class="process_dot" :style="'background:'+(setting.defaultColor)"></text>
                    <text class="process_item_title">{{processLineItem.title}}</text>
                  </view>
                  <view class="process_item_content" :style="'border-left:1rpx solid '+(setting.defaultColor)">
                    <text class="process_item_content_text">{{processLineItem.content}}</text>
                  </view>
                </view>
              </view>
              <view class="add_process" :data-item="publicFun.toStringFun(items)" @click.stop.prevent="addProcessLineItemFun">
                <image class="add_process_icon" src="https://image1.sansancloud.com/jianzhan/2018_10/22/18/4/3_874.jpg?x-oss-process=style/preview_120"></image>
                <text>添加{{itemData.title}}</text>
              </view>
            </view>
            
        </view>
    </view>
    
    <view class="support_measure common" v-if="formData.attendSupportMeasures==1">
      <view class="inputName">
        
        <text>多规格</text>
      </view>
      <view class="support_measure_list" v-if="measurePriceList&&measurePriceList.length!=0">
        <view v-for="(measurePriceItem,index) in (measurePriceList)" class="support_measure_item" :style="'background:'+(setting.defaultColor)">
          <text class="support_measure_item_name">{{measurePriceItem.attendMeasureName}}-￥{{measurePriceItem.attendPrice}}</text>
          <view class="delete_support_measure_item" :data-index="index" @click.stop.prevent="deleteMeasureItem">x</view>
        </view>
      </view>
      <view class="no_support_measure_list" v-else>
        <text>暂无数据</text>
      </view>
      <view class="add_measures" @click.stop.prevent="addMeasuresItemFun">
        <image class="add_measures_icon" src="https://image1.sansancloud.com/jianzhan/2018_10/22/18/4/3_874.jpg?x-oss-process=style/preview_120"></image>
      </view>
    </view>
    
    
    <view class="saveData" v-if="showformSubmitBtn&&formType=='form'">
      <button class="saveBtn" formType="submit" :style="'background:'+(setting.defaultColor)+';color:#fff'">{{formData.commitName}}</button>
      <button class="checkFormList" @click="toFormCommitList" :style="'background:'+(setting.secondColor)+';color:#fff'">我的记录</button>
    </view>
    <view class="saveData" v-if="showformSubmitBtn&&formType=='formChain'">
      <button class="saveBtn" @click="perStepFun" v-if="formChainData.curIndex>0" :style="'width:50%;background:'+(setting.secondColor)+';color:#fff'">上一步</button>
      <button class="saveBtn" formType="submit" v-if="formChainData.curIndex<formChainData.totalLength-1" :style="'width:'+(formChainData.curIndex==0?"100%":"50%")+';background:'+(setting.defaultColor)+';color:#fff'">下一步</button>
      <button class="saveBtn" formType="submit" v-if="formChainData.curIndex==formChainData.totalLength-1" :style="'width:'+(formChainData.curIndex==0?"100%":"50%")+';background:'+(setting.defaultColor)+';color:#fff'">完成</button>
    </view>
  </view>
  <view class="formHead" v-if="formData&&formData.description">
    <view class="formDescription">
      <view class="tip">
        <image class="tipIcon" src="https://image1.sansancloud.com/xianhua/2019_1/11/10/6/7_837.jpg"></image>
        <text>Tip:</text>
      </view>
      <text class="tipText">{{formData.description}}</text>
    </view>
  </view>
</view>
<view class="zhezhao" v-if="showMask||showMaskTwo" @click="closeZhezhao"></view>
<view class="add_measures_popup" v-if="showMask">
  <view class="add_measures_popup_title">
    <text>添加规格</text>
  </view>
  <form @submit="sureMeasuresData" report-submit class="add_measures_popup_list">
    <view class="add_measures_popup_item">
      <text class="add_measures_popup_item_name">名称</text>
      <input name="attendMeasureName" class="add_measures_popup_item_input" placeholder="请输入名称"></input>
    </view>
    <view class="add_measures_popup_item">
      <text class="add_measures_popup_item_name">价格</text>
      <input type="digit" name="attendPrice" class="add_measures_popup_item_input" placeholder="请输入价格"></input>
    </view>
    <view class="add_measures_popup_item">
      <text class="add_measures_popup_item_name">供货价</text>
      <input type="digit" name="attendSupplyPrice" class="add_measures_popup_item_input" placeholder="请输入供货价"></input>
    </view>
    <view class="add_measures_popup_item">
      <text class="add_measures_popup_item_name">库存</text>
      <input type="number" name="attendStock" class="add_measures_popup_item_input" placeholder="请输入库存"></input>
    </view>
    <view class="saveData">
      <button class="saveBtn" formType="submit" :style="'background:'+(setting.defaultColor)+';color:#fff'">确定</button>
    </view>
  </form>
</view>

<view class="add_measures_popup" v-if="showMaskTwo">
  <view class="add_measures_popup_title">
    <text>添加{{currentProcessLineData.title}}</text>
  </view>
  <form @submit="sureProcessData" report-submit class="add_measures_popup_list">
    <view class="add_measures_popup_item">
      <text class="add_measures_popup_item_name" v-if="currentProcessLineData.remark&&currentProcessLineData.remark.title">{{currentProcessLineData.remark.title}}</text>
      <text class="add_measures_popup_item_name" v-else>标题</text>
      <input name="title" class="add_measures_popup_item_input" :placeholder="'请输入'+(currentProcessLineData.remark&&currentProcessLineData.remark.title?currentProcessLineData.remark.title:"标题")"></input>
    </view>
    <view class="add_measures_popup_item" style="align-items:flex-start;">
      <text class="add_measures_popup_item_name" v-if="currentProcessLineData.remark&&currentProcessLineData.remark.content">{{currentProcessLineData.remark.content}}</text>
      <text class="add_measures_popup_item_name" v-else>内容</text>
      <textarea class="add_measures_popup_item_input" style="height:190rpx;" maxlength="-1" auto-height :placeholder="'请输入'+(currentProcessLineData.remark&&currentProcessLineData.remark.content?currentProcessLineData.remark.content:"内容")" name="content"></textarea>
    </view>
    <view class="saveData">
      <button class="saveBtn" formType="submit" :style="'background:'+(setting.defaultColor)+';color:#fff'">确定</button>
    </view>
  </form>
</view>
</form></uni-shadow-root>
</template>
<wxs src="../../public/publicFun.wxs" module="publicFun"></wxs>
<script>

global['__wxRoute'] = 'partials/form_detail/index'
const app = getApp();
import { dateTimePicker, getMonthDay } from "../../public/requestUrl.js";
Component({
  properties: {
    receiveData: {
      type: Object,
    },
    receiveLocationList: {
      type: Object,
    },
    showBtn:{//是否显示提交按钮
      type: String,
    },
    showTitle: {//是否显示标题
      type: String,
    },
    showSubmitPopup: {//是否需要提交数据后弹窗确认
      type: String,
    },
    userAddressCustomFormCommitId:{
      type: String,
    }
  },
  data: {
    formData:null,
    formType:"form",
    formChainData:null,
    sexArray:['男','女'],
    selectPicker:{},
    upLoadImageList:{},
    dataAndTime:{},
    commonData:{},
    showformSubmitBtn:false,
    showSubmitPopup:false,
    processType: false,
    refProductFormType: false,
    formTypeState:false,
    productId:0,
    skuData: {
      productId: 0,
      itemCount: 1,
      shopId: 0,
      cartesianId: 0,
      fromSource: 'mini',
      orderType: 0,
      pintuanCreateType: 0,
      pintuanRecordId: 0
    },
    gainActionEvent: {},
    region: {},
    checkboxList: {},
    formId:0,
    reqLocation:false,
    locationList:{},
    inputValue:{},
    locationIndex:"",
    multistageData:null,//级联数据
    multiIndex:null,//选择级联位置
    currentMultiData:{},
    haveFormData:null,
    showCheckBoxState: [],
    showRadioState: [],
    showRadioStateObj: {},
    measurePriceList: [],
    showMask: false,
    animationData: {}, //抽屉
    limitStockData:['不限制','限制'],
    selectLimitStockIndex:0,
    controlFieldShow:{},//控制字段的显示隐藏
    dateTimeObj: {},
    dateTimeIndexObj: {},
    processLineData: {},//进程
    showMaskTwo:false,
    currentProcessLineData:{},
    radioChildrenList:[],
  },
  ready: function () {
    let that = this;
    that.setData({ setting: app.globalData.setting.platformSetting,loginUser: app.globalData.loginUser  })
    console.log(that.data.receiveData)
    console.log("====userAddressCustomFormCommitId===", that.data.userAddressCustomFormCommitId)
    console.log("====showBtn===", that.data.showBtn)
    console.log("==locationList==", that.data.locationList,that.data.receiveLocationList)
    console.log("===selectAddress=====", that.data.selectAddress)
    let options = that.data.receiveData
    that.data.gainActionEvent = options.actionEvent||0
    that.setData({ formId: options.customFormId })
    if (that.data.showBtn =='true'){
      that.setData({ showformSubmitBtn:true})
    } else {
      that.setData({ showformSubmitBtn: false })
    }
    if (options && options.actionEvent) {
      that.data.processType = true;
    } else {
      that.data.processType = false;
    }
    if (options && options.formType=='pyq') {
      that.data.formTypeState = true;
    } else {
      that.data.formTypeState = false;
    }
    if (options && options.productId) {
      that.data.refProductFormType = true;
      that.data.productId = options.productId
      if (options.params) {
        that.data.skuData = JSON.parse(options.params)
      } else {
        that.data.skuData = that.skuData;
      }
    } else {
      that.data.refProductFormType = false;
    }
    if (options.formChainData){
      that.setData({ formType: 'formChain', formChainData: options.formChainData})
      console.log("====表单集合链功能===", options.formChainData)
    }
    let formDetailData = app.globalData.AddClientUrl("/wx_get_custom_form.html", { customFormId: options.customFormId }, 'get')
    console.log('==formDetailData===', formDetailData)
    wx.request({
      url: formDetailData.url,
      data: formDetailData.params,
      header: app.globalData.headerPost,
      method: 'get',
      success: function (res) {
        console.log(res)
        let formData = res.data.relateObj;
        if (that.data.userAddressCustomFormCommitId&&that.data.userAddressCustomFormCommitId!=0){
          that.getDetail(that.data.userAddressCustomFormCommitId, formData)
        }else{
          that.setFormDataFun(formData)
        }
        if (that.data.showTitle!='false'){
          wx.setNavigationBarTitle({
            title: res.data.relateObj.formName
          })
        }
      }
    })
  },
  methods: {
    selectRegionFun:function(e){
        let index = e.currentTarget.dataset.index
        this.triggerEvent('selectRegion', { regionIndex: index}) 
    },
    addProcessLineItemFun:function(e){
      console.log("====addProcessLineItemFun====",e)
      let that=this;
      let itemData = e.currentTarget.dataset.item;
      if(itemData&&itemData!=""){
          itemData=JSON.parse(itemData)
      }
      that.setData({ currentProcessLineData: itemData, showMaskTwo:true})
    },
    sureProcessData: function (e) {
      console.log("======sureProcessData=======", e)
      let that = this;
      let processLineData = that.data.processLineData;
      let currentProcessLineData = that.data.currentProcessLineData;
      console.log("currentProcessLineData", currentProcessLineData)
      let resultData = e.detail.value;
      if (!resultData.title) {
        let content = currentProcessLineData.remark && currentProcessLineData.remark.title ? currentProcessLineData.remark.title : "标题"
        wx.showModal({
          title: '提示',
          content: '主人~您的' + content +'还没填写哦!',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return;
      } else if(!resultData.content) {
        let content = currentProcessLineData.remark && currentProcessLineData.remark.content ? currentProcessLineData.remark.content : "内容"
        wx.showModal({
          title: '提示',
          content: '主人~您的' + content+'还没填写哦!',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return;
      }  else {
        processLineData[currentProcessLineData.name].splice(processLineData[currentProcessLineData.name].length, 0, resultData)
        that.setData({ processLineData: processLineData })
        that.closeZhezhao()
      }
    },
    deleteProcessItem:function(e){
      console.log("======deleteProcessItem=======", e)
      let that = this;
      let index = e.currentTarget.dataset.index;
      let name = e.currentTarget.dataset.name;
      let processLineData = that.data.processLineData
      processLineData[name].splice(index, 1)
      that.setData({ processLineData: processLineData })
    },
    limitStockStateFun:function(e){
      console.log("======limitStockStateFun=======", e)
      let selectLimitStockIndex=e.detail.value;
      this.setData({ selectLimitStockIndex: selectLimitStockIndex})
    },
    deleteMeasureItem:function(e){
      console.log("======deleteMeasureItem=======",e)
      let that=this;
      let index = e.currentTarget.dataset.index;
      let measurePriceList = that.data.measurePriceList
      measurePriceList.splice(index, 1)
      that.setData({ measurePriceList: measurePriceList })
    },
    sureMeasuresData:function(e){
      console.log("======sureMeasuresData=======", e)
      let that=this;
      let measurePriceList = that.data.measurePriceList
      let resultData = e.detail.value;
      if (!resultData.attendMeasureName){
        wx.showModal({
          title: '提示',
          content: '主人~您的规格名还没填写哦!',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return;
      }else if (!resultData.attendPrice) {
        wx.showModal({
          title: '提示',
          content: '主人~您的规格价格还没填写哦!',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return;
      } else if (!resultData.attendStock) {
        wx.showModal({
          title: '提示',
          content: '主人~您的规格库存还没填写哦!',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return;
      }else{
        measurePriceList.splice(measurePriceList.length, 0, resultData)
        that.setData({ measurePriceList: measurePriceList})
        that.closeZhezhao()
      }
    },
    addMeasuresItemFun:function(){
      let that=this;
      console.log("=======addMeasuresItemFun=======", that.data.measurePriceList)
      that.setData({ showMask: !that.data.showMask })
      let animation = wx.createAnimation({
        duration: 400,
        timingFunction: 'ease',
      })
      console.log("=======popupFormPage==========", animation, that.data.showMask)
      if (that.data.showMask) {
        animation.bottom('100rpx').step()
      } else {
        animation.bottom('-100rpx').step()
      }
      that.setData({
        animationData: animation.export()
      })
    },
    closeZhezhao: function () {
      this.setData({ showMask: false,showMaskTwo: false })
      let animation = wx.createAnimation({
        duration: 400,
        timingFunction: 'ease',
      })
      animation.bottom('-100rpx').step()
      let setData = animation.export()
      this.setData({
        animationData: setData,
      })
    },
    toImgUrl: function (event) {
      console.log(event.currentTarget.dataset.link)
      console.log("===========e==========", event.currentTarget.dataset.url)
      app.globalData.linkEvent(event.currentTarget.dataset.link);
    },
    saveImageToLocal: function (e) {
      let imgSrc = e.currentTarget.dataset.imageurl
      console.log(imgSrc)
      let PostImageSrc = imgSrc.replace(/http/, "https")
      console.log(PostImageSrc)
      if (!imgSrc) {
        return
      }
      let urls = []
      urls.push(imgSrc)
      wx.previewImage({
        current: imgSrc, // 当前显示图片的http链接
        urls: urls // 需要预览的图片http链接列表
      })
    },
    getDetail: function (formCommitId, data) {
      let that = this;
      if (that.data.formType != 'formChain') {
        wx.showToast({
          title: '加载中...',
          icon: 'loading',
        })
      }
      let formDetailData = app.globalData.AddClientUrl("/wx_get_custom_form_commit.html", { formCommitId: formCommitId }, 'get')
      wx.request({
        url: formDetailData.url,
        data: formDetailData.params,
        header: app.globalData.headerPost,
        method: 'get',
        success: function (res) {
          console.log("====success====", res)
          if (res.data.errcode == 0) {
            wx.hideLoading()
            that.setFormDataFun(data, JSON.parse(res.data.relateObj.commitJson))
          } else {
            wx.showToast({
              title: '加载失败...',
              icon: 'none',
              duration: 2000,
            })
            wx.navigateBack(
              { delta: 1, }
            )
          }
        }
      })
    },
    setFormDataFun: function (formData,jsonData){
      let that=this;
      console.log("===jsonData===", jsonData)
      console.log("===formData===", formData)
      let haveFormData=[];
      for (let i = 0; i < formData.items.length;i++){
        if (formData.items[i].formHide==0){
          haveFormData.push(formData.items[i])
        }
      }
      formData.items = haveFormData;
      if (formData.items.length > 0) {
        let upLoadImageList = {};
        let region = {};
        let dataAndTime = {};
        let selectPicker = {};
        let controlFieldShow = that.data.controlFieldShow
        for (let i = 0; i < formData.items.length; i++) {
          controlFieldShow[formData.items[i].name] = true;
        }
        for (let i = 0; i < formData.items.length; i++) {
          if (formData.items[i].listValues && (formData.items[i].type == 2 || formData.items[i].type == 4 || formData.items[i].type == 3)) {
            if (formData.items[i].type != 3){
              formData.items[i].listValues = formData.items[i].listValues.split(",")
            }
            let name = "picker_";
            if (formData.items[i].type == 4){
              name ='checkbox_'
            }
            if (formData.items[i].type == 3) {
              name = 'radio_'
            } 
            if (jsonData&&jsonData[formData.items[i].name]){
              selectPicker[name + i] = jsonData[formData.items[i].name].value
            }else{
              if (formData.items[i].defaultValue) {
                console.log("下拉框有值")
                selectPicker[name + i] = formData.items[i].defaultValue
              } else {
                console.log("下拉框没值")
                selectPicker[name + i] = ""
              }
            }
            if (formData.items[i].type == 3) {
              formData.items[i].listValues = JSON.parse(formData.items[i].listValues)
              let listValues = formData.items[i].listValues
              console.log("===listValues===", listValues)
              selectPicker['radio_' + i] = formData.items[i].defaultValue||'-1'
              let showRadioStateObj=that.data.showRadioStateObj;
              showRadioStateObj['radio_'+i]=[]
              let radioChildrenList=that.data.radioChildrenList
              for (let j=0;j<listValues.length;j++){
                showRadioStateObj['radio_'+i][j]=false;
                if (listValues[j].children){
                  let childrenItemList = listValues[j].children.split(',')
                  radioChildrenList = radioChildrenList.concat(childrenItemList);
                  console.log("====childrenItemList====", childrenItemList)
                  for (let g = 0; g < childrenItemList.length; g++) {
                    console.log("=======childrenItemList[g]==========", childrenItemList[g])
                    if (controlFieldShow[childrenItemList[g]]){
                      controlFieldShow[childrenItemList[g]]=false;
                    }
                  }
                }
              }
              for (let j=0;j<listValues.length;j++){
                // showRadioStateObj['radio_'+i][j]=false;
                // if (listValues[j].children){
                //   let childrenItemList = listValues[j].children.split(',')
                //   radioChildrenList = radioChildrenList.concat(childrenItemList);
                //   console.log("====childrenItemList====", childrenItemList)
                //   for (let g = 0; g < childrenItemList.length; g++) {
                //     console.log("=======childrenItemList[g]==========", childrenItemList[g])
                //     if (controlFieldShow[childrenItemList[g]]){
                //       controlFieldShow[childrenItemList[g]]=false;
                //     }
                //   }
                // }
                if (jsonData&&jsonData[formData.items[i].name]){
                  selectPicker[name + i] = jsonData[formData.items[i].name].value
                  if (jsonData[formData.items[i].name].value && listValues[j].value == jsonData[formData.items[i].name].value){
                      showRadioStateObj['radio_'+i][j] = true;
                      if (listValues[j].children) {
                        let childrenItemList = listValues[j].children.split(',')
                        console.log("==jsonData-childrenItemList===", childrenItemList)
                        for (let k = 0; k < childrenItemList.length; k++) {
                          console.log("=======jsonData-childrenItemList[k]==========", childrenItemList[k], controlFieldShow[childrenItemList[k]])
                          controlFieldShow[childrenItemList[k]] = true;
                        }
                      }
                  }
                }
                if (formData.items[i].defaultValue && listValues[j].value == formData.items[i].defaultValue){
                  console.log("====单选===", formData.items[i].defaultValue)
                  showRadioStateObj['radio_'+i][j] = true;
                  if (listValues[j].children) {
                    let childrenItemList = listValues[j].children.split(',')
                    console.log("==childrenItemList===", childrenItemList)
                    for (let k = 0; k < childrenItemList.length; k++) {
                      console.log("=======childrenItemList[k]==========", childrenItemList[k], controlFieldShow[childrenItemList[k]])
                      controlFieldShow[childrenItemList[k]] = true;
                    }
                  }
                }
              }
              let haveRadioChildrenList=[]
              for (let k = 0; k < radioChildrenList.length;k++){
                if (haveRadioChildrenList.indexOf(radioChildrenList[k]) == -1) {
                  haveRadioChildrenList.push(radioChildrenList[k])
                }
              }
              console.log("=======showRadioState========", showRadioStateObj, radioChildrenList, haveRadioChildrenList, controlFieldShow)
              that.setData({ showRadioStateObj: showRadioStateObj, radioChildrenList: haveRadioChildrenList ,})
            }
            console.log("=======selectPicker========", selectPicker)
            that.setData({
              selectPicker: selectPicker
            })
            if (formData.items[i].type == 4){
              let checkboxList=selectPicker['checkbox_' + i];
              let listValues =formData.items[i].listValues;
              let showCheckBoxState=[]
              for (let j = 0; j < listValues.length; j++) {
                console.log("====listValues=====", listValues[j])
                let count = 0;
                for (let k = 0; k < checkboxList.length; k++) {
                  console.log("====checkbox=====", checkboxList[k])
                  if (listValues[j] != checkboxList[k]) {
                    console.log("======", listValues[j], checkboxList[k])
                    count++
                  } else {
                    console.log("!======", listValues[j], checkboxList[k])
                  }
                }
                if (count != checkboxList.length) {
                  console.log("===count===", count)
                  showCheckBoxState.splice(j, 1, true)
                } else {
                  console.log("!count======", count)
                  showCheckBoxState.splice(j, 1, false)
                }
              }
              that.setData({ showCheckBoxState: showCheckBoxState})
            }
            console.log("=======selectPicker======", selectPicker)
          } else if (formData.items[i].listValues && formData.items[i].type == 13) {//多级联的初始化
            let one=0;
            let two=0;
            let three = 0;
            let four = 0;
            let five = 0;
            let index = 0
            try {
              formData.items[i].listValues = JSON.parse(formData.items[i].listValues)
            } catch (e) {
              console.log(e);
              wx.showModal({
                title: '提示',
                content: formData.items[i].title + "(" + formData.items[i].name+")" + "字段的JSON数据格式不对",
                success: function (res) {
                  if (res.confirm) {
                    console.log('用户点击确定')
                    wx.navigateBack()
                  } else if (res.cancel) {
                    console.log('用户点击取消')
                    wx.navigateBack()
                  }
                }
              })
              return
            }
            let listValues = formData.items[i].listValues
            console.log("=======listValues2======", i,listValues)
            if (formData.items[i].defaultValue){
              let defaultValue = JSON.parse(formData.items[i].defaultValue);
              console.log("=====defaultValue----13====", defaultValue)
              for (let k = 0; k < listValues.length; k++) {
                if (listValues[k].name == defaultValue[index]) {
                  // 一级
                  one = k;
                  index++ 
                  let childrenTwo = listValues[k].children
                  for (let l = 0; l < childrenTwo.length; l++) {
                    if (childrenTwo[l].name == defaultValue[index]) {
                      // 二级
                      two = l;
                      index++
                      let childrenThree = childrenTwo[l].children
                      for (let n = 0; n < childrenThree.length; n++) {
                        if (childrenThree[n].name == defaultValue[index]) {
                          // 三级
                          three = n;
                          index++
                          let childrenFour = childrenThree[n].children
                          if (childrenFour&&childrenFour.length!=0){
                            for (let m = 0; m < childrenFour.length; m++) {
                              if (defaultValue && defaultValue.length>=4&&childrenFour[m].name == defaultValue[index]) {
                                // 四级
                                four = m;
                                index++
                                let childrenfive = childrenFour[m].children
                                if (childrenfive&&childrenfive.length!=0){
                                  for (let o = 0; o < childrenfive.length; o++) {
                                    if (defaultValue &&defaultValue.length>=5&&childrenfive[o].name == defaultValue[index]) {
                                      // 五级
                                      five = o;
                                    }
                                  }
                                }else{
                                  five=0
                                }
                              }else{
                                four=0
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              that.setMultiPicker(formData.items[i], one, two, three, four,five);
            }else{
              that.setMultiPicker(formData.items[i], 0, 0, 0, 0, 0);
            }
          } else if (formData.items[i].type == 9999) {
            formData.items[i].splitStyle = JSON.parse(formData.items[i].splitStyle);
          } else if (formData.items[i].type == 7 || formData.items[i].type == 11) {
            upLoadImageList['img_' + i] = [];
            if (jsonData && jsonData[formData.items[i].name]) {
              let defaultValue = jsonData[formData.items[i].name].value
              if(defaultValue){
                if (typeof (defaultValue) == 'object') {
                  upLoadImageList['img_' + i] = defaultValue
                } else {
                  upLoadImageList['img_' + i].push(defaultValue)
                }
              }
            } else {
              if (formData.items[i].defaultValue) {
                let defaultValue;
                try {
                  defaultValue = JSON.parse(formData.items[i].defaultValue);
                } catch (e) {
                  defaultValue = formData.items[i].defaultValue
                  console.log(e);
                }
                if (typeof (defaultValue) == 'object') {
                  upLoadImageList['img_' + i] = defaultValue
                } else {
                  upLoadImageList['img_' + i].push(defaultValue)
                }
              }
            }
            that.setData({
              upLoadImageList: upLoadImageList
            })
          } else if (formData.items[i].type == 10) {
            if (formData.items[i].defaultValue) {
              console.log("地址有值")
              let defaultRegion;
              try {
                defaultRegion = JSON.parse(formData.items[i].defaultValue).join(",")
              } catch (e) {
                defaultRegion = formData.items[i].defaultValue
                console.log(e);
              }
              region['address_' + i] = defaultRegion
            } else {
              console.log("地址没值")
              region['address_' + i] = "请选择您的地址"
            }
            that.setData({
              region: region
            })
          } else if (formData.items[i].type == 5 || formData.items[i].type == 6) {
            if (jsonData && jsonData[formData.items[i].name]) {
              dataAndTime[formData.items[i].name] = jsonData[formData.items[i].name].value
            }else{
              if (formData.items[i].defaultValue) {
                console.log("日期时间有值")
                dataAndTime[formData.items[i].name] = formData.items[i].defaultValue
              } else {
                console.log("日期时间没值")
                dataAndTime[formData.items[i].name] = ""
              }
            }
            that.setData({
              dataAndTime: dataAndTime
            })
          } else if (formData.items[i].type == 8) {
            let name = formData.items[i].name
            let dateTimeObj = that.data.dateTimeObj
            let dateTimeIndexObj = that.data.dateTimeIndexObj
            let dataAndTime = that.data.dataAndTime
            let obj = dateTimePicker(2019, 2050);
            if (formData.items[i].defaultValue) {
              console.log("日期时间有值", formData.items[i].defaultValue)
              let defaultValue = formData.items[i].defaultValue 
              let oldData = [...defaultValue.split(' ')[0].split('-'), ...defaultValue.split(' ')[1].split(':')]
              let year = oldData[0] + '年';
              let month = oldData[1] + '月';
              let date = oldData[2] + '日';
              let hours = oldData[3] + '时';
              let minutes = oldData[4] + '分';
              console.log("defaultValue", defaultValue)
              let value = [year, month, date].join('-') + " " + [hours, minutes].join(':')
              console.log("==value====", value)
              obj = dateTimePicker(2019, 2050, value)
            } else {
              console.log("日期时间没值")
            }
            let lastArray = obj.dateTimeArray.pop();
            let lastTime = obj.dateTime.pop();
            dateTimeObj[name] = obj.dateTimeArray
            dateTimeIndexObj[name] = obj.dateTime
            dataAndTime[name] = dateTimeObj[name][0][dateTimeIndexObj[name][0]].slice(0, -1) + "-" + dateTimeObj[name][1][dateTimeIndexObj[name][1]].slice(0, -1) + "-" + dateTimeObj[name][2][dateTimeIndexObj[name][2]].slice(0, -1) + " " + dateTimeObj[name][3][dateTimeIndexObj[name][3]].slice(0, -1) + ":" + dateTimeObj[name][4][dateTimeIndexObj[name][4]].slice(0, -1);
            that.setData({
              dataAndTime: dataAndTime,
              dateTimeObj: dateTimeObj,
              dateTimeIndexObj: dateTimeIndexObj,
            })
            console.log("=============obj=============", obj)
          } else if (formData.items[i].type == 15) {
            let processLineData = that.data.processLineData;
            let commonData = that.data.commonData;
            if (formData.items[i].remark){
              formData.items[i].remark = JSON.parse(formData.items[i].remark)
            }
            if (formData.items[i].defaultValue) {
              console.log("进程有值", formData.items[i].defaultValue)
              commonData[formData.items[i].name] = formData.items[i].defaultValue
              try {
                processLineData[formData.items[i].name] = JSON.parse(formData.items[i].defaultValue)
              } catch (e) {
                processLineData[formData.items[i].name] = formData.items[i].defaultValue
                console.log(e);
              }
            } else {
              console.log("进程没值")
              commonData[formData.items[i].name] = ""
              processLineData[formData.items[i].name] = []
            }
            that.setData({
              commonData: commonData,
              processLineData: processLineData
            })
          }else {
            if (jsonData && jsonData[formData.items[i].name]){
              formData.items[i].defaultValue = jsonData[formData.items[i].name].value
            }
          }
        }
        that.setData({ formData: formData, controlFieldShow: controlFieldShow })
        console.log("=====controlFieldShow====",that.data.formData, controlFieldShow)
      }
    },
    saveSearchValue: function (e) {
      console.log("====saveSearchValue======", e)
      let that=this;
      let name = e.currentTarget.dataset.name;
      let value = e.detail.value
      let inputValue = that.data.inputValue;
      inputValue[name] = value;
      that.setData({ inputValue: inputValue })
      console.log("====inputValue======", that.data.inputValue)
    },
    // 时间日期
    changeDateTimeColumn1(e) {
      console.log("===changeDateTimeColumn1===", e)
      let that = this;
      let itemData = e.currentTarget.dataset.itemdata;
      if(itemData&&itemData!=""){
          itemData=JSON.parse(itemData)
      }
      let dateTimeObj = that.data.dateTimeObj
      let dateTimeIndexObj = that.data.dateTimeIndexObj
      let dataAndTime = that.data.dataAndTime
      console.log("===dateTimeIndexObj===", dateTimeIndexObj, dateTimeObj)
      dateTimeIndexObj[itemData.name][e.detail.column] = e.detail.value;
      let year = dateTimeObj[itemData.name][0][dateTimeIndexObj[itemData.name][0]].slice(0, -1);
      let month = dateTimeObj[itemData.name][1][dateTimeIndexObj[itemData.name][1]].slice(0, -1)
      dateTimeObj[itemData.name][2] = getMonthDay(year, month);
      if (dateTimeIndexObj[itemData.name][2] >= dateTimeObj[itemData.name][2].length){
        dateTimeIndexObj[itemData.name][2] = dateTimeObj[itemData.name][2].length - 1
      }
      dataAndTime[itemData.name] = dateTimeObj[itemData.name][0][dateTimeIndexObj[itemData.name][0]].slice(0, -1) + "-" + dateTimeObj[itemData.name][1][dateTimeIndexObj[itemData.name][1]].slice(0, -1) + "-" + dateTimeObj[itemData.name][2][dateTimeIndexObj[itemData.name][2]].slice(0, -1) + " " + dateTimeObj[itemData.name][3][dateTimeIndexObj[itemData.name][3]].slice(0, -1) + ":" + dateTimeObj[itemData.name][4][dateTimeIndexObj[itemData.name][4]].slice(0, -1)
      this.setData({
        dateTimeObj: dateTimeObj,
        dateTimeIndexObj: dateTimeIndexObj,
        dataAndTime: dataAndTime
      });
    },
    changeDateTime1(e) {
      console.log("====changeDateTime1====", e)
      let that = this;
      let itemData = e.currentTarget.dataset.itemdata;
      if(itemData&&itemData!=""){
          itemData=JSON.parse(itemData)
      }
      let dateTimeIndexObj = that.data.dateTimeIndexObj
      dateTimeIndexObj[itemData.name] = e.detail.value
      this.setData({ dateTimeIndexObj: dateTimeIndexObj });
    },
    // 多级联
    getCurrentData: function (e) {
      console.log("getCurrentData", e);
      let that = this;
      let itemData = e.currentTarget.dataset.itemdata
      if(itemData&&itemData!=""){
          itemData=JSON.parse(itemData)
      }
      that.setData({ currentMultiData: itemData })
    },
    bindMultiPickerChange: function (e) {
      console.log('picker发送选择改变，携带值为', e.detail.value)
    },
    bindMultiPickerColumnChange: function (e) {
      let that = this;
      console.log('修改的列为', e.detail.column, '，值为', e.detail.value);
      let currentMultiData = that.data.currentMultiData
      console.log('====currentMultiData=====', currentMultiData);
      let multiIndex = that.data.multiIndex||{}
      switch (e.detail.column) {
        // 一级联
        case 0:
          that.setMultiPicker(currentMultiData, e.detail.value, 0, 0, 0, 0);
          break;
        // 二级联
        case 1:
          that.setMultiPicker(currentMultiData, multiIndex[currentMultiData.name][0], e.detail.value, 0,0,0);
          break;
        //三级联
        case 2:
          that.setMultiPicker(currentMultiData, multiIndex[currentMultiData.name][0], multiIndex[currentMultiData.name][1], e.detail.value,0,0);
          break;
        //四级联
        case 3:
          that.setMultiPicker(currentMultiData, multiIndex[currentMultiData.name][0], multiIndex[currentMultiData.name][1], multiIndex[currentMultiData.name][2],e.detail.value,0);
          break;
        //五级联
        case 4:
          that.setMultiPicker(currentMultiData, multiIndex[currentMultiData.name][0], multiIndex[currentMultiData.name][1],multiIndex[currentMultiData.name][2],multiIndex[currentMultiData.name][3], e.detail.value);
          break;
      }
    },
    setMultiPicker: function (itemData, indexOne, indexTwo, indexThree, indexFour, indexFive){
      let that=this;
      let dataA = that.data.multistageData||{};
      let multiIndex = that.data.multiIndex||{};
      let objName = itemData.name
      let currentData = itemData.listValues
      console.log("====currentData====", currentData)
      dataA[objName] = [];
      dataA[objName][0] = [];
      multiIndex[objName] = [indexOne, indexTwo, indexThree, indexFour, indexFive];//当前多级联的选择数据
      // 一级
      for (let j = 0; j < currentData.length; j++) {
        dataA[objName][0].push(currentData[j].name)
      }
      //二级
      if (currentData[indexOne].children&&currentData[indexOne].children.length != 0) {
        dataA[objName][1] = [];
        for (let k = 0; k < currentData[indexOne].children.length; k++) {
          dataA[objName][1].push(currentData[indexOne].children[k].name)
        }
      }
      //三级
      if (currentData[indexOne].children[indexTwo].children&&currentData[indexOne].children[indexTwo].children.length != 0) {
        dataA[objName][2] = [];
        for (let l = 0; l < currentData[indexOne].children[indexTwo].children.length; l++) {
          dataA[objName][2].push(currentData[indexOne].children[indexTwo].children[l].name)
        }
      }
      //四级
      if (currentData[indexOne].children[indexTwo].children&&currentData[indexOne].children[indexTwo].children.length!=0&&currentData[indexOne].children[indexTwo].children[indexThree].children && currentData[indexOne].children[indexTwo].children[indexThree].children.length != 0) {
        dataA[objName][3] = [];
        for (let m = 0; m < currentData[indexOne].children[indexTwo].children[indexThree].children.length; m++) {
          dataA[objName][3].push(currentData[indexOne].children[indexTwo].children[indexThree].children[m].name)
        }
      }
      //五级
      if (currentData[indexOne].children[indexTwo].children&&currentData[indexOne].children[indexTwo].children.length != 0 && currentData[indexOne].children[indexTwo].children[indexThree].children && currentData[indexOne].children[indexTwo].children[indexThree].children.length!=0&&currentData[indexOne].children[indexTwo].children[indexThree].children[indexFour].children && currentData[indexOne].children[indexTwo].children[indexThree].children[indexFour].children.length != 0) {
        dataA[objName][4] = [];
        for (let n = 0; n < currentData[indexOne].children[indexTwo].children[indexThree].children[indexFour].children.length; n++) {
          dataA[objName][4].push(currentData[indexOne].children[indexTwo].children[indexThree].children[indexFour].children[n].name)
        }
      }
      console.log("===dataA====", dataA)
      console.log("===multiIndex====", multiIndex)
      that.setData({
        multistageData: dataA,
        multiIndex: multiIndex
      })
    },
    selectAddressFun:function(data){
      let that=this;
      console.log("===selectAddress===",data)
      that.setData({ locationList: data})
    },
    checkboxChange:function(e){
      console.log('checkbox发生change事件，携带value值为：', e)
      let index = e.target.dataset.index
      let that = this;
      let selectPicker = that.data.selectPicker;
      selectPicker['checkbox_' + index] = e.detail.value
      this.setData({
        selectPicker: selectPicker
      })
      console.log("=====selectPicker=====", selectPicker)
    },
    radioChange: function (e) {
      console.log('radioChange发生change事件，携带value值为：', e)
      let that = this;
      let index = e.target.dataset.index;
      let itemValue = e.target.dataset.value;
      let value = e.detail.value
      let name = e.currentTarget.dataset.name
      let controlFieldShow = that.data.controlFieldShow;
      let radioChildrenList = that.data.radioChildrenList;
      console.log("radioChildrenList",radioChildrenList)
      if (name !='_selfMulBuyObject'){
          for (let i = 0; i < radioChildrenList.length;i++){
            controlFieldShow[radioChildrenList[i]] = false;
          }
          for (let i = 0; i < itemValue.length; i++) {
            if (value == itemValue[i].value && itemValue[i].children) {
              let childrenData = itemValue[i].children.split(",")
              console.log("childrenData", childrenData)
              for (let j = 0; j < childrenData.length; j++) {
                controlFieldShow[childrenData[j]] = true
              }
            }
          }
        that.setData({ controlFieldShow: controlFieldShow})
      }
      let selectPicker = that.data.selectPicker;
      selectPicker['radio_' + index] = value
      this.setData({
        selectPicker: selectPicker,
      })
      console.log("=====selectPicker=====", selectPicker)
    },
  // 关闭海报
  getChilrenPoster(e) {
    let that = this;
    that.setData({
      posterState: false,
    })
  },
  showPoster: function () {
    let that = this;
    console.log('===showPoster====', that.data.formId)
    let ewmImgUrl = app.globalData.getQrCode({ type: "form_detail", id: that.data.formId })
    that.setData({
      posterState: true,
      ewmImgUrl: ewmImgUrl,
    })
  },
  bindDateChange: function (e) {
    console.log('picker发送选择改变，携带值为', e, this.data.formData)
    let index = e.target.dataset.index
    this.data.dataAndTime[this.data.formData.items[index].name] = e.detail.value
    this.data.formData.items[index].defaultValue = e.detail.value
    this.setData({
      dataAndTime: this.data.dataAndTime
    })
  },
  bindTimeChange: function (e) {
    console.log('picker发送选择改变，携带值为', e, this.data.formData)
    let index = e.target.dataset.index
    this.data.dataAndTime[this.data.formData.items[index].name] = e.detail.value
    this.data.formData.items[index].defaultValue = e.detail.value
    this.setData({
      dataAndTime: this.data.dataAndTime
    })
  },
  bindRegionChange: function (data) {
    console.log('picker发送选择改变，携带值为', data)
    let index = data.index
    let that=this;
    let region = that.data.region;
    region['address_' + index] = data.value.join(' ')
    this.setData({
      region: region
    })
  },
  // bindRegionChange: function (e) {
  //   console.log('picker发送选择改变，携带值为', e.detail.value)
  //   let index = e.target.dataset.index
  //   let that=this;
  //   let region = that.data.region;
  //   region['address_' + index] = e.detail.value
  //   this.setData({
  //     region: region
  //   })
  // },
  tolinkUrl: function (e) {
    if (!app.globalData.loginUser) {
      wx.showModal({
        title: '提示',
        content: '主人~您还在登陆哦!稍等片刻',
        success: function (res) {
          if (res.confirm) {
            console.log('用户点击确定')
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
      return
    }
    let that = this;
    let linkUrl = e.currentTarget.dataset.link
    let index = e.currentTarget.dataset.index
    if (linkUrl.indexOf("select_location.html") != -1) {
      console.log("选择位置")
      that.triggerEvent('selectPsotion', { locationIndex: "position_" + index}) //myevent自定义名称事件，父组件中使用
      that.setData({ reqLocation: true, locationIndex: "position_" + index})
    } else {
      that.setData({ reqLocation: false })
    }
    app.globalData.linkEvent(linkUrl + "?locationIndex=" + "position_" + index)
  },
  // 返回首页
  toFormCommitList: function (){
    var a = "form_commit_list.html?self=1&customFormId=" + this.data.formId;
    app.globalData.linkEvent(a);
  },
  // 返回首页
  toFormLogList: function (){
    var a = "user_log_list.html?customFormId=" + this.data.formId;
    app.globalData.linkEvent(a,'reLaunch');
  },
  toProcessList: function (formCommitId) {
    let that=this;
    setTimeout(function () { wx.navigateBack() }, 200);
    if (app.globalData.preCallbackObj['processInstanceItem'] && app.globalData.preCallbackObj['processInstanceItem'].callback){
      app.globalData.preCallbackObj['processInstanceItem'].callback(formCommitId);
    }
  },
  login: function(e) {
    wx.switchTab({
      url: '../../pageTab/custom_page_index/index',
    })
  },
  bindPickerChange:function(event){
    console.log('====index', event)
    let that=this;
    let value = event.currentTarget.dataset.value
    let index = event.currentTarget.dataset.index
    let selectIndex = event.detail.value
    if(typeof(value)=='string'){
        value=value.split(',')
    }
    that.data.selectPicker["picker_" + index] = value[selectIndex]
    that.setData({ selectPicker: that.data.selectPicker})
  },
    formSubmit: function (e, measureData){
    console.log('form发生了submit事件，携带数据为：', e)
    var that = this;
    let measurePriceList = that.data.measurePriceList;
    console.log('===that.data.formData.items===', that.data.formData.items, that.data.formData.userCanCommit,that.data.formData)
    if (that.data.formData.userCanCommit == 0) {
      wx.showModal({
        title: '提示',
        content: '您没有权限提交数据',
        success: function (res) {
          if (res.confirm) {
            console.log('用户点击确定')
            app.globalData.navigateBack(1000)
          } else if (res.cancel) {
            console.log('用户点击取消')
            app.globalData.navigateBack(1000)
          }
        }
      })
      return;
    };
    let newObj={}
    let params={};
    let value={}
    params.customFormId = that.data.formId;
    if (that.data.formData.attendSupportMeasures == 1) {
      params.measurePriceList = JSON.stringify(measurePriceList);
    }
    if (measureData){
      console.log("=======传了多规格数据=========", measureData)
      params = Object.assign({}, params, { attendMeasureList:JSON.stringify(measureData)})
    }
    if (e && e.detail){
      value = e.detail.value
      params.miniNotifyFormId = e.detail.formId;
    }else{
      if(e){
        params.parentCommitId=e//子组件传过来的记录id
      }
      for (let i = 0; i < that.data.formData.items.length; i++) {
        let name = that.data.formData.items[i].name;
        if ((that.data.formData.items[i].type == 0 || that.data.formData.items[i].type == 9 || that.data.formData.items[i].type == 1 || that.data.formData.items[i].type == 14)&& (!that.data.inputValue[name] && that.data.inputValue[name]!=='')){
          that.data.inputValue[name] = that.data.formData.items[i].defaultValue||"";
        }
      }
      value =that.data.inputValue;
    }
    console.log('===value1=====', value)
    let imgObj = {};
    let positionObj = {};
    let dataAndTime = {};
    let selectPicker = {};
    let region = {}
    let checkboxList = {}
    let radioList = {}
    let multistageData = {}
    let processLineData = {}
    for (let i = 0; i<that.data.formData.items.length;i++){
      if (that.data.formData.items[i].type == 7||that.data.formData.items[i].type ==11){
        imgObj[that.data.formData.items[i].name] = that.data.upLoadImageList['img_' + i]||""
      }else if (that.data.formData.items[i].type == 10) {
        region[that.data.formData.items[i].name] = that.data.region['address_' + i] !='请选择您的地址'?that.data.region['address_' + i] : ""
      } else if (that.data.formData.items[i].type == 5 || that.data.formData.items[i].type == 6 ) {
        dataAndTime[that.data.formData.items[i].name] = that.data.dataAndTime[that.data.formData.items[i].name] || ""
      } else if ( that.data.formData.items[i].type == 8) {
        dataAndTime[that.data.formData.items[i].name] = that.data.dataAndTime[that.data.formData.items[i].name]+":00" || ""
      } else if (that.data.formData.items[i].type == 2) {
        selectPicker[that.data.formData.items[i].name] = that.data.selectPicker['picker_' + i] || ""
      } else if (that.data.formData.items[i].type == 3) {
        radioList[that.data.formData.items[i].name] = that.data.selectPicker['radio_' + i] || ""
      } else if (that.data.formData.items[i].type == 4) {
        checkboxList[that.data.formData.items[i].name] = that.data.selectPicker['checkbox_' + i] || ""
      }else if (that.data.formData.items[i].type == 12) {
        positionObj[that.data.formData.items[i].name] = that.data.locationList['position_' + i] || ""
      } else if (that.data.formData.items[i].type == 15) {
        processLineData[that.data.formData.items[i].name] = JSON.stringify(that.data.processLineData[that.data.formData.items[i].name]) || ""
      } else if (that.data.formData.items[i].type == 13) {
        console.log("that.data.formData.items[i].name", that.data.formData.items[i].name)
        let multistageDataObj = that.data.multistageData[that.data.formData.items[i].name];
        let multiIndexObj = that.data.multiIndex[that.data.formData.items[i].name]
        console.log("===multiIndexObj====", multistageDataObj, multiIndexObj)
        multistageData[that.data.formData.items[i].name] = []
        if (multistageDataObj.length != 0) {
          for (let j = 0; j < multistageDataObj.length; j++) {
            console.log(multistageDataObj[j][multiIndexObj[j]])
            multistageData[that.data.formData.items[i].name].push(multistageDataObj[j][multiIndexObj[j]])
          }
        }
        console.log("====multistageData=====", multistageData)
      }else if (that.data.formData.items[i].type ==0){

      }
    }
      value = Object.assign({}, value, imgObj, positionObj, region, dataAndTime, selectPicker, multistageData, checkboxList, radioList, processLineData)
    console.log('===value2=====', value, that.data.formData)
    let itemData = that.data.formData.items
    // return
    console.log('===itemData====', itemData)
    let controlFieldShow = that.data.controlFieldShow;
    for (let i = 0; i < itemData.length;i++){
      newObj[itemData[i].name] = { value: value[itemData[i].name] || "", title: itemData[i].title, type: itemData[i].type, showInList: itemData[i].showInList, showInListOrder: itemData[i].showInListOrder }
      console.log("===controlFieldShow====", itemData[i].name, controlFieldShow[itemData[i].name])
      if ((itemData[i].mustInput == 1 && (!value[itemData[i].name] || value[itemData[i].name].length == 0|| (itemData[i].type == 3 && value[itemData[i].name] == -1))) && controlFieldShow[itemData[i].name]) {
        wx.showModal({
          title: '提示',
          content: '请填写完整',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定')
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
        return
      } 
    }
    console.log("==newObj====", newObj)
    params.formJson = JSON.stringify(newObj);
    if (that.data.userAddressCustomFormCommitId){//编辑表单的提交ID
      params.customFromCommitId = that.data.userAddressCustomFormCommitId
    }
    if (that.data.showSubmitPopup&&that.data.showSubmitPopup == 'false') {
      that.sureSubimtFun(params)
    } else {
      wx.showModal({
        title: '提示',
        content: '您确认提交嘛?',
        success: function (res) {
          if (res.confirm) {
            console.log('用户点击确定')
            that.sureSubimtFun(params)
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
    }
  },
  perStepFun:function(){
    console.log("====perStepFun====");
    let that=this;
    if (that.data.formType == 'formChain') {
      console.log("===formChainData===", that.data.formChainData)
      let perStepIndex = that.data.formChainData.curIndex - 1
      that.triggerEvent('perStep', { perStepIndex: perStepIndex }) //myevent自定义名称事件，父组件中使用
    }
  },
  sureSubimtFun: function (params){
    let that=this;
    let sendParams = params;
    if (that.data.formType == 'formChain') {
      console.log("===formChainData===", that.data.formChainData)
      sendParams = Object.assign({}, sendParams,{
        customFormChainInstanceId: that.data.formChainData.chainInstanceId
      })
    }
    console.log("sendParams", sendParams)
    app.globalData.showToastLoading("请稍等~",true)
    var formData = app.globalData.AddClientUrl("/wx_commit_custom_form.html", sendParams, 'post')
    wx.request({
      url: formData.url,
      data: formData.params,
      header: app.globalData.headerPost,
      success: function (res) {
        console.log(res.data)
        wx.hideLoading()
        if (res.data.errcode == '0') {
          if (that.data.formType == 'formChain' && that.data.formChainData.curIndex < that.data.formChainData.totalLength-1){
          } else if (that.data.formType == 'formChain' && that.data.formChainData.curIndex >= that.data.formChainData.totalLength - 1) {
            wx.showToast({
              title: '全部提交成功！',
              icon: 'success',
              duration: 1000
            })
          }  else {
            wx.showToast({
              title: '提交成功',
              icon: 'success',
              duration: 1000
            })
          }
          if (!that.data.showformSubmitBtn) {
            let param = {};
            console.log("======1===========")
            if (res.data.relateObj.result_type) {
              param = { formId: res.data.relateObj.result.id, result: res.data.relateObj.result }
            } else {
              param = { formId: res.data.relateObj.id }
            }
            that.triggerEvent('sendDataFun', param) //myevent自定义名称事件，父组件中使用
          }
          if (that.data.formType =='formChain'){
            console.log("===formChainData===", that.data.formChainData)
            let nextStepIndex = that.data.formChainData.curIndex + 1
            that.triggerEvent('nextStep', { nextStepIndex: nextStepIndex }) //myevent自定义名称事件，父组件中使用
          }else{
            if (that.data.processType) {
              console.log("======2===========")
              setTimeout(function () {
                that.toProcessList(res.data.relateObj.id)
              }, 1000)
            } else if (that.data.refProductFormType) {
              console.log("======3===========")
              let baseProData = {
                productId: that.data.skuData.productId,
                itemCount: that.data.skuData.itemCount,
                shopId: that.data.skuData.shopId,
                cartesianId: that.data.skuData.cartesianId,
                fromSource: 'mini',
                orderType: that.data.skuData.orderType,
              };
              let pintuanData = {
                pintuanCreateType: that.data.skuData.pintuanCreateType,
                pintuanRecordId: that.data.skuData.pintuanRecordId,
              };
              app.globalData.createOrder(baseProData, pintuanData, res.data.relateObj.id)
            } else if (that.data.formData.refProductId && that.data.formData.refProductId != 0) {
              console.log("======4===========")
              let baseProData = {
                productId: that.data.formData.refProductId,
                itemCount: 1,
                shopId: 0,
                cartesianId: 0,
                fromSource: 'mini',
                orderType: 0,
              };
              let pintuanData = {
                pintuanCreateType: 0,
                pintuanRecordId: 0
              };
              app.globalData.createOrder(baseProData, pintuanData, res.data.relateObj.id)
            } else if (!that.data.showformSubmitBtn) {
              console.log("======5===========")
            } else if (that.data.formTypeState) {
              console.log("======6===========")
              setTimeout(function () {
                that.toFormLogList()
              }, 1000)
            }else {
              console.log("======7===========")
              setTimeout(function () {
                that.toFormCommitList()
              }, 1000)
            }
          }
        } else {
          wx.showToast({
            title: res.data.errMsg,
            image: '/wxcomponents/images/icons/tip.png',
            duration: 1000
          })
        }
      },
      fail: function (res) {
        console.log(res.data)
      },
      complete: function (res) {
        wx.stopPullDownRefresh()
      }
    })
  },
  removeImg:function(event){
    let that=this;
    console.log('======event==',event);
    let index = event.currentTarget.dataset.index;
    let num = event.currentTarget.dataset.num;
    that.data.upLoadImageList['img_' + index].splice(num, 1);
    console.log('that.data.upLoadImageList', that.data.upLoadImageList);
    that.setData({ upLoadImageList: that.data.upLoadImageList })
  },
  addCommitImage: function (e) {
    console.log('===addCommitImage=',e)
    var that = this;
    let index = e.currentTarget.dataset.index;
    let count=1;
    let type = e.currentTarget.dataset.type;
    let upLoadImageList = that.data.upLoadImageList
    if (!that.data.upLoadImageList['img_' + index]){
      that.data.upLoadImageList['img_' + index]=[];//初始化数据
    }
    if (type == 7 ){
      count=1;
      if (upLoadImageList['img_' + index]&&upLoadImageList['img_' + index].length == 1){
        console.log("只能选一张")
        wx.showToast({
          title: "只能选一张",
          icon: 'none',
          duration: 2000
        })
        return
      }
    } else if (type == 11) {
      console.log("可选多张")
      count=9
    }
    wx.chooseImage({
      count: count - upLoadImageList['img_' + index].length, // 默认9
      sizeType: ['compressed'], // 可以指定是原图还是压缩图，默认二者都有
      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
      success: function (res) {
        console.log("===chooseImage===",res)
        let tempFilePaths = res.tempFilePaths
        for (let i = 0; i < tempFilePaths.length;i++){
          that.uploadImage(tempFilePaths[i], tempFilePaths.length, index)
        }
      }
    })
  },
  uploadImage: function (tempFilePaths,count,index) {
    if (!app.globalData.loginUser) {
      app.globalData.echoErr('用户未登录')
      return
    }
    console.log("====count====",count,app.globalData.loginUser)
    let that = this
    let param = {
      userId: app.globalData.loginUser.id
    }
    console.log("==upLoadImageList===", that.data.upLoadImageList)
    var customIndex = app.globalData.AddClientUrl("/file_uploading.html", param, 'POST')
    wx.uploadFile({
      url: customIndex.url, //接口地址
      filePath: tempFilePaths,
      name: 'file',
      formData: customIndex.params,
      header: {'content-type': 'multipart/form-data'},
      success: function (res) {
        let upLoadImageList = that.data.upLoadImageList
        var data = res.data
        console.log("===success===",data)
        if (typeof (data) == 'string') {
          data = JSON.parse(data)
          console.log("====string====",data)
          if (data.errcode == 0) {
            upLoadImageList['img_' + index].push(data.relateObj.imageUrl)
            that.setData({
              upLoadImageList: upLoadImageList
            })
          }
        } else if (typeof (data) == 'object') {
          console.log("===object====", data)
          if (data.errcode == 0) {
            upLoadImageList['img_' + index].push(data.relateObj.imageUrl)
            that.setData({
              upLoadImageList: upLoadImageList
            })
          }
        }
        console.log('==upLoadImageList==',that.data.upLoadImageList)
      }, fail: function (e) {
        console.log(e)
      }, complete: function (e) {

      }
    })
  },
  },
})
export default global['__wxComponents']['partials/form_detail/index']
</script>
<style platform="mp-weixin">
.formDetailContent{
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f5f5;
  position: relative;
  margin-bottom: 100rpx;
}
.formBanner{
  width: 100%;
  box-sizing:border-box;
  background:#fff;
}
.bannerUrl{
  width: 100%;
  height: 100%
}
.formHead{
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 28rpx;
  padding: 20rpx;
  width: 100%;
  box-sizing: border-box;
}
.formName{
  padding:0 0 20rpx 0;
  font-size: 34rpx;
  font-weight: bold;
  letter-spacing: 2rpx;
  color:#444444;
}
.formDescription{
  letter-spacing: 2rpx;
  line-height:32rpx;
  font-size:22rpx;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  color: #888;
  width: 100%
}
.tip{
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-right: 20rpx;
}
.tipIcon{
  width: 32rpx;
  height: 32rpx;
  margin-right: 6rpx
}
.tipText{
  width: 80%;
}
.formContent{
  display: flex;
  flex-direction: column;
  justify-content: center;
  width:100%;
  padding: 20rpx;
  box-sizing: border-box;
}
.common{
  background: #fff;
  border-radius: 6rpx;
  min-height: 80rpx;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 18rpx;
  margin: 2rpx 0;
  justify-content: space-between;
  font-size:28rpx;
}
.inputName{
  font-size: 28rpx;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.inputString input{
  text-align: right;
  width: 60%
}
.inputString textarea {
  text-align:left;
  padding: 20rpx 10rpx 10rpx 20rpx;
  width:96%;
  /* border:1rpx solid #eee; */
  background: #f9f9f9;
  margin-top:10rpx;
  min-height: 200rpx;
}
.pickerRight{
  height:76rpx;
  display:flex;
  align-items:center;
  width:40rpx;
  float:right;
}
.pickerValue{
  width:400rpx;
  height:80rpx;
  float: left;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}
.pickerImg{
  width: 26rpx;
  float: right;
  height: 26rpx;
}
.imgType{
  flex-direction: column;
  align-items: flex-start;
  background: #fff; 
  height:100%;
  font-size:34rpx;
}
.imgName{
  margin-top: 15rpx;
  font-size: 28rpx;
}
.selectName{
  font-size: 28rpx;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.upload{
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-flow: wrap;
  margin-top:15rpx;
}
.uploadImg{
  width: 200rpx;
  height: 200rpx;
  border:2rpx dashed #ccc;
  display: flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  margin-bottom: 15rpx
}
.uploadImgIcon{
  width: 50rpx;
  height: 50rpx
}
.uploadedImgUrl{
  width: 200rpx;
  height: 200rpx;
  margin-right: 18rpx;
  border-radius: 4rpx
}
.uploadedImg{
  margin-bottom: 15rpx;
  position: relative;
}
.removeImgBg{
  width:150rpx;
  height: 40rpx;
  background: #888;
  opacity: 0.5;
  position: absolute;
}
.removeImgIcon{
  position: absolute;
  right: 18rpx;
  top: 0rpx;
  border-bottom-left-radius: 6px;
  width: 30rpx;
  height: 30rpx;
  background: #888;
  font-size: 20rpx;
  text-align:center;
  color: #fff
}
.saveData{
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-top:20rpx;
  font-size:20rpx;
  position:fixed;
  bottom:0;
  left:0;
  background:#fff;
  padding:20rpx;
  box-sizing:border-box;
  border-top:1rpx solid #eee;
}
.saveData button{
  font-size:30rpx;
}
.picker{
  width: 460rpx;
  height: 80rpx;
  line-height:76rpx;
  text-align:right;
  float:left;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}
.saveBtn{
  width: 60%;
  margin:0 10rpx;
}
.checkFormList{
  width: 35%
}
.checkFormList:after {
  border: none;
}
.saveBtn:after {
  border: none;
}
.shareFormPoster{
  position: fixed;
  top: 66%;
  right: 20rpx;
  width: 80rpx;
  height: 80rpx;
  border-radius: 80rpx;
  display: flex;
  flex-direction:row;
  align-items: center;
  justify-content: center;
  z-index:10;
}
.shareFormPosterImg{
  width: 70rpx;
  height: 70rpx;
}
.form_detail_location{
  display: flex;
  align-items: center;
  flex-direction: row;
  height: 50rpx;
  width: 70%;
  justify-content: space-between
}
.select_address{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.interval{
  display: flex;
  align-items: center;
  padding:5px;
  /* padding-left:5px; */
}
.interval_banner{
  width: 100%;
  display: block;
}
.checkboxList{
  display: flex;
  margin: 10rpx 20rpx;
  flex-direction: column;
  width:96%;
}
.checkbox{
  padding: 18rpx 0;
  border-bottom: 1rpx solid #eee;
}
.checkbox:last-child{
  border-bottom: none;
  padding-bottom: 0
}
.zhezhao{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:#000;
  opacity:0.6;
  z-index:9;
}
.support_measure{
  flex-direction:row;
  background:#fff;
  height:100%;
  font-size:34rpx;
}
/* 进程 */
.process_line{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:none;
  padding: 20rpx 0
}
.process_list{
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom:20rpx;
}
.process_item{
  position: relative;
  display: flex;
  flex-direction: column;
  background:#fff;
  margin-bottom:10rpx;
  padding:10rpx 20rpx;
  border-radius:10rpx;
}
.process_item:last-child .process_item_content{
  border: none !important 
}
.process_item_top{
  display: flex;
  flex-direction: row;
  align-items: center;
}
.process_dot{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 14rpx;
  height: 14rpx;
  border-radius: 14rpx;
}
.process_item_title{
  display: flex;
  align-items: center;
  color: #ccc;
  font-size: 24rpx;
  margin-left: 20rpx;
  width:80%;
}
.process_item_content{
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 20rpx;
  margin-left: 6rpx;
}
.process_item_content_text{
  color: #666;
}
.delete_process_item{
  position:absolute;
  top:0;
  right:0;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  background:hsla(0,0%,60%,.6);
  font-size:20rpx;
  line-height:30rpx;
  color:#fff;
  padding:0 10rpx 0 16rpx;
  letter-spacing:6rpx;
}
.add_process{
  height:50rpx;
  border:2rpx dashed #999;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  margin-left: 10rpx;
  padding: 0 20rpx;
  font-size: 26rpx;
}
.add_process_icon{
  width: 30rpx;
  height: 30rpx;
  margin-right: 10rpx
}
/* 多规格 */
.add_measures{
  width:50rpx;
  height:50rpx;
  border:2rpx dashed #ccc;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  margin-left: 10rpx;
}
.add_measures_icon{
  width: 30rpx;
  height: 30rpx
}
.add_measures_popup{
  position: fixed;
  top: 50%;
  margin-top: -260rpx;
  left: 50%;
  margin-left: -300rpx;
  width: 600rpx;
  height: 540rpx;
  background: #fff;
  border-radius: 10rpx;
  z-index: 11;
  box-sizing:border-box;
  padding:20rpx;
  font-size: 30rpx;
}
.add_measures_popup_title{
  display: flex;
  flex-direction: row;
  align-items: center;
  border-bottom: 1rpx solid #f1f1f1;
  padding: 10rpx 0;
  font-weight:bold;
  margin-bottom:40rpx;
}
.add_measures_popup_list{
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
}
.add_measures_popup_item{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20rpx;
}
.add_measures_popup_item_input{
  width:76%;
  border:1rpx solid #f1f1f1;
  padding:10rpx;
}
.no_support_measure_list{
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 70%;
  font-size: 26rpx;
  color: #999
}
.support_measure_list{
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  width: 70%;
  padding:20rpx;
}
.support_measure_item{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8rpx 20rpx;
  color: #fff;
  border-radius: 10rpx;
  position: relative;
  font-size: 26rpx;
  margin:10rpx;
}
.delete_support_measure_item{
  position: absolute;
  top: -12rpx;
  right: -10rpx;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 30rpx;
  height: 30rpx;
  background:hsla(0,0%,60%,.6);
  border-radius:30rpx;
  font-size:24rpx;
  line-height:30rpx;
}
</style>